<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
    <script src="../../js/lay-module/http/http.js"></script>
</head>
<body onload="verifyToken()">
<div class="layui-form layuimini-form">
        <div class="layui-bg-gray" style="padding: 30px;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">上传用户列表文件</div>
                    <div class="layui-card-body">
                        <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>
                        <button class="layui-btn layui-btn-primary layui-border-black">
                            <a href="../../images/用户模板文件.xlsx">模板文件下载</a>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    var img;
    layui.use('upload', function(){
        var upload = layui.upload;

        //执行实例
        upload.render({
            elem: '#test3',
            headers: {
                'Authorization': layui.data('table')['Authorization']
            },
            url: $api + 'user/import', //此处配置你自己的上传接口即可
            accept: 'file', //普通文件
            done: function(res){
                identifyCode(res);
                if (res.code == 0) {
                    layer.msg('上传成功');
                }
            }
        });
    });
</script>
</body>
</html>